package com.java;

import com.java.demo.ArticleInfo;
import com.java.demo.controller.UserController;
import com.java.demo.service.IService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class App {
    public static void main(String[] args) {
        //1.创建上下文对象
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");

        //2.获取Bean对象
        UserController userController = context.getBean("userController",UserController.class);

//        IService iService = context.getBean("IService",IService.class);
//        ArticleInfo articleInfo = context.getBean("art4",ArticleInfo.class);

        //3.使用Bean对象
        userController.sayHi();
//        iService.sayHi();
//        System.out.println(articleInfo.toString());

    }
}
